Telegram Group & Telegram Channel
🧠 RegExp: Как найти строки с IP-адресами в логах

Частая задача — выцепить IP-адреса из логов. Вот регулярка и однострочник, которые помогут:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log


📌 Что делает:
- -Eo — включаем расширенные регулярки и выводим только совпадения
- ([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон для IPv4-адресов

💡 Можно дополнительно убрать дубликаты и отсортировать по частоте:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head


🚀 Покажет топ IP-адресов по количеству обращений — удобно для анализа трафика и выявления подозрительной активности.



tg-me.com/pro_python_code/1799
Create:
Last Update:

🧠 RegExp: Как найти строки с IP-адресами в логах

Частая задача — выцепить IP-адреса из логов. Вот регулярка и однострочник, которые помогут:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log


📌 Что делает:
- -Eo — включаем расширенные регулярки и выводим только совпадения
- ([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон для IPv4-адресов

💡 Можно дополнительно убрать дубликаты и отсортировать по частоте:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head


🚀 Покажет топ IP-адресов по количеству обращений — удобно для анализа трафика и выявления подозрительной активности.

BY Python RU




Share with your friend now:
tg-me.com/pro_python_code/1799

View MORE
Open in Telegram


Python RU Telegram | DID YOU KNOW?

Date: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Python RU from de


Telegram Python RU
FROM USA